package com.hundsun.yr.universal.p2p.interactor.impl;

import android.content.Context;
import android.text.TextUtils;

import com.hundsun.mobile.zwgt.R;
import com.hundsun.yr.universal.p2p.interactor.base.SegmentInteractor;
import com.hundsun.yr.universal.p2p.ui.activity.base.BaseFragment;
import com.hundsun.yr.universal.p2p.ui.fragment.InHandFragment;
import com.hundsun.yr.universal.p2p.ui.fragment.TransferInFragment;
import com.hundsun.yr.universal.p2p.ui.fragment.WaitPayFragment;

import java.util.ArrayList;
import java.util.List;


/**
 * @version V1.0
 * @Title: MineInvestSegmentInteractorImpl.java
 * @Description: 我的投资Segment集合
 * @date 2015-12-29 上午10:43:21
 * @author:hejun.shen
 * @email:shenhj15971@hundsun.com
 * @replace author:
 * @replace date:
 */
public class MineInvestSegmentInteractorImpl implements SegmentInteractor {
    @Override
    public List<BaseFragment> getFragments(Context context) {
        // TODO Auto-generated method stub
        List<BaseFragment> fragments = new ArrayList<BaseFragment>();
        String[] segments = context.getResources().getStringArray(R.array.mine_invest_segment);

        for (int i = 0; i < segments.length; i++) {
            //先将数据全都放到已投资里面
            /*if (TextUtils.equals(segments[i], context.getString(R.string.mine_invested))) {
                fragments.add(i, new AlreadyInvestFragment());
            } else */
            if (TextUtils.equals(segments[i], context.getString(R.string.mine_waitpay))) {
                fragments.add(i, new WaitPayFragment());
            } else if (TextUtils.equals(segments[i], context.getString(R.string.mine_transfering))) {
                fragments.add(i, new TransferInFragment());
            } else if (TextUtils.equals(segments[i], context.getString(R.string.mine_inhand))) {
                fragments.add(i, new InHandFragment());
            }
        }
        return fragments;
    }
}
